<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title></title>
    <style>
        .errorMsg{
            font-size: 12px;
            color: red;
        }
    </style>
    <script src="js/jquery-3.3.1.min.js"></script>
    <script>
        function reloadImg() {
            console.log(111)
            $('#randImg').attr('src','code?time='+new Date().getTime())
        }
    </script>
</head>
<body>
    <h2>用户登陆</h2>
    <span class="errorMsg">
<%--        <%--%>
<%--            Object errorMsg = request.getAttribute("errorMsg");--%>
<%--        %>--%>
<%--        <%=errorMsg!=null ? errorMsg : ""%>--%>
        ${errorMsg}
    </span>
    <form action="login" method="post">
        用户名：<input type="text" name="username"> <br>
        密码：<input type="password" name="password"> <br>
        验证码：<input type="text" name="code"> <img src="code" onclick="reloadImg()" id="randImg"> <br>
        <input type="submit" value="登陆">
    </form>
</body>
</html>
